<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>4DVDS Shop Manager</title>
    </h:head>
    <h:body>
        <ui:composition template="../Master/MasterPage.xhtml">
            <ui:define name="isa1">
                <h:outputText value="#{malbum_Addnew.message}" escape="false"/>
                <div class="t-title">
                    <h3><h:commandLink value="MANAGER ALBUM" action="#{malbum_Edit.redirectIndex}"/> -> ADD NEW DISC</h3>
                    <div class="t-in">
                        <div style="">
                            <table width="100%">
                                <tr>
                                    <td>
                                        Categories
                                    </td>
                                    <td>
                                        <h:selectOneMenu class="commoboxIm" onchange="submit()" 
                                                         value="#{malbum_Addnew.idCategories}">
                                            <f:selectItems value="#{malbum_Addnew.listCategories}"/>
                                            <p:ajax listener="#{malbum_Addnew.categoriesValuesChange}"/>
                                        </h:selectOneMenu>
                                       
                                    </td>
                                </tr>
                                <tr>
                                    <td width="120px">
                                        Title Disc
                                    </td>
                                    <td>
                                        <h:inputText class="inputIm" requiredMessage="Enter name album" required="true" id="namealbum" value="#{malbum_Addnew.albumName}">
                                        </h:inputText>

                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Price
                                    </td>
                                    <td>
                                        <h:inputText class="inputIm" required="true" requiredMessage="Enter Price" id="albumprice" value="#{malbum_Addnew.albumPrice}">
                                        </h:inputText>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Quantity
                                    </td>
                                    <td>
                                        <h:selectOneMenu class="commoboxIm" onchange="submit()" 
                                                         value="#{malbum_Addnew.numberQuantity}">
                                            <f:selectItems value="#{malbum_Addnew.listQuantity}"/>
                                            <p:ajax listener="#{malbum_Addnew.quantityListChange}"/>
                                        </h:selectOneMenu>
                                    </td>
                                </tr>
                                <tr>
                                    <td valign="middle">
                                    </td>
                                    <td>
                                        <p:editor id="editor" value="#{malbum_Addnew.detailsAlbum}" width="600"/>  
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Album Image
                                    </td>
                                    <td>
                                        <h:form enctype="multipart/form-data">
                                            <h:inputText id="msga" class="inputIm" disabled="true" style="background-color: #ECEBEC" 
                                                         value="#{fileUploadController.file}"/>
                                            <p:fileUpload fileUploadListener="#{fileUploadController.handleFileUpload}"
                                                          mode="advance" value="#{fileUploadController.file}"
                                                          update="msga,messages"
                                                          oncomplete="true"
                                                          label="Choose a file"
                                                          sizeLimit="10485760"
                                                          allowTypes="/(\.|\/)(img|jpg|gif|png)$/"
                                                          invalidSizeMessage="The maximum file size allowed is 1 Megabyte !"
                                                          invalidFileMessage="You are allowed to upload only images !"/>
                                            <p:growl id="messages" showDetail="true" sticky="true"/>
                                        </h:form>
                                    </td>
                                    <tr>
                                        <td>

                                        </td>
                                        <td align="right">
                                            <h:commandButton id="btnumaddnew" value="Add new" class="expoler-window" action="#{malbum_Addnew.btnumaddnew_Click}"/>
                                        </td>
                                    </tr>
                                </tr>
                            </table>
                        </div>
                    </div>
                </div>
                <ui:include src="data_addnew.xhtml">
                    
                </ui:include>
            </ui:define>
        </ui:composition>
    </h:body>
</html>

